home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 43 / Amiga Format CD43 (1999)(Future Publishing)(GB)(Track 1 of 2)[!][issue 1999-09].iso / -serious- / programming / other / flexcat / lib / c_c_v21.sd < prev    next >
Text File  |  1999-06-14  |  2KB  |  76 lines

  1. ##stringtype C
  2. ##shortstrings
  3. /****************************************************************
  4.    This file was created automatically by `%fv'
  5.    from "%f0".
  6.  
  7.    Do NOT edit by hand!
  8. ****************************************************************/
  9.  
  10. #if defined(__SASC)  ||  defined(_DCC)
  11. #include <proto/locale.h>
  12. #elif defined(__GNUC__)
  13. #include <inline/locale.h>
  14. #else
  15. #include <clib/locale_protos.h>
  16. #endif
  17.  
  18.  
  19.  
  20.  
  21. static LONG %b_Version = %v;
  22. static const STRPTR %b_BuiltInLanguage = (STRPTR) %l;
  23.  
  24. struct FC_Type
  25. {   LONG   ID;
  26.     STRPTR Str;
  27. };
  28.  
  29.  
  30. const struct FC_Type _%i = { %d, %s };
  31.  
  32.  
  33. static struct Catalog *%b_Catalog = NULL;
  34.  
  35. void Open%bCatalog(struct Locale *loc, STRPTR language)
  36. { LONG tag, tagarg;
  37.   extern struct Library *LocaleBase;
  38.   extern void Close%bCatalog(void);
  39.  
  40.   Close%bCatalog(); /* Not needed if the programmer pairs Open%bCatalog
  41.                and Close%bCatalog right, but does no harm.  */
  42.  
  43.   if (LocaleBase != NULL  &&  %b_Catalog == NULL)
  44.   { if (language == NULL)
  45.     { tag = TAG_IGNORE;
  46.     }
  47.     else
  48.     { tag = OC_Language;
  49.       tagarg = (LONG) language;
  50.     }
  51.     %b_Catalog = OpenCatalog(loc, (STRPTR) "%b.catalog",
  52.                 OC_BuiltInLanguage, %b_BuiltInLanguage,
  53.                 tag, tagarg,
  54.                 OC_Version, %b_Version,
  55.                 TAG_DONE);
  56.   }
  57. }
  58.  
  59. void Close%bCatalog(void)
  60. { if (LocaleBase != NULL)
  61.   { CloseCatalog(%b_Catalog);
  62.   }
  63.   %b_Catalog = NULL;
  64. }
  65.  
  66. STRPTR Get%bString(APTR fcstr)
  67. { STRPTR defaultstr;
  68.   LONG strnum;
  69.  
  70.   strnum = ((struct FC_Type *) fcstr)->ID;
  71.   defaultstr = ((struct FC_Type *) fcstr)->Str;
  72.  
  73.   return(%b_Catalog ? GetCatalogStr(%b_Catalog, strnum, defaultstr) :
  74.               defaultstr);
  75. }
  76.